import { get, post, del } from "../utils/request";
// 获取产品列表
export const getGoodList = function (params: any) {
  return get("/api/good", params);
};
// 获取销售排行
export const getRank = function (params: any) {
  return get("/api/good/rank", params);
};
// 创建产品
export const createProduct = function (data: any) {
  return post("/api/good", data);
};
// 创建产品规格
export const createProductLabel = function (id: any, data: any) {
  return post("/api/good/standard?goodId=" + id, data);
};
// // 获取产品分类 /api/category
export const getCategory = async () => {
  return get("/api/category");
};
// 删除产品
export const delProduct = async (id: any) => {
  return del("/api/good/" + id);
};
// 获取销售数据
export const getSaleData = async (token: any) => {
  return get("/api/income/chart", {}, token);
};
// 获取周销售数据
export const getSaleWeekData = async (token: any) => {
  return get("/api/income/week", {}, token);
};
// 获取月销售数据
export const getSaleMonthData = async (token: any) => {
  return get("/api/income/month", {}, token);
};
